<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>注册 - 用户中心</title>

    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css"/>
    <link href="css/main.css" rel="stylesheet" type="text/css"/>

    <script type="text/javascript" src="js/jquery-3.0.0.min.js"></script>
    <script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
<!-- 网页头部开始 -->
<nav class="navbar navbar-default navbar-fixed-top">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed"
                    data-toggle="collapse" data-target="#navbar" aria-expanded="false"
                    aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span> <span
                    class="icon-bar"></span> <span class="icon-bar"></span> <span
                    class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">LOGO</a>
        </div>
        <!--<div id="navbar" class="navbar-collapse collapse">-->
        <!--<ul class="nav navbar-nav navbar-right">-->
        <!--<li><a href="#">首页</a></li>-->
        <!--<li><a href="login.html">登陆</a></li>-->
        <!--<li><a href="regsiter.html">注册</a></li>-->
        <!--</ul>-->
        <!--<form class="navbar-form navbar-right visible-sm">-->
        <!--<input type="text" class="form-control" placeholder="Search...">-->
        <!--</form>-->
        <!--</div>-->
    </div>
</nav>
<div class="container">
    <div class="col-sm-8 col-sm-offset-1">
        <form id="form" class="form-horizontal" method="post"
              action="/guahaoSub">
            <h2 class="col-sm-offset-1 form-signin-heading">添加信息</h2>
            <div class="form-group">
                <label for="name" class="col-sm-2 control-label">姓名</label>
                <div class="col-sm-8">
                    <input type="text" name="name" id="name" value=""
                           class="form-control" placeholder="姓名">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">性别</label>
                <div class="col-sm-8">
                    <!--<input type="text" name="sex" id="sex"
                        class="form-control" placeholder="性别" />-->
                    <label for="sex">
                        <input id="sex" type="radio" name="sex" value="男" checked="checked">男
                    </label>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <label for="sex2">
                        <input id="sex2" type="radio" name="sex" value="女">女
                    </label>
                </div>
            </div>
            <div class="form-group">
                <label for="identity" class="col-sm-2 control-label">身份证号</label>
                <div class="col-sm-8">
                    <input type="text" name="identity" id="identity"
                           class="form-control" placeholder="身份证号"/>
                </div>
            </div>
            <!--<div class="form-group">
                <label for="code" class="col-sm-2 control-label">验证码</label>
                <div class="col-sm-8">
                    <div class="input-group">
                        <span class="input-group-addon"> <a href="#" tabindex="-1"
                            onclick="return refreshCode('imgCode');"> <img id="imgCode"
                                src="/usersCenter-head/imgCode.html" title="点击刷新验证码" width="75"
                                height="20" />
                        </a>
                        </span> <input type="text" name="code" id="code" class="form-control"
                            placeholder="验证码">
                    </div>
                </div>
            </div>-->


            <h2 class="sub-header">选择医生科室:</h2>
            <select id="doctor_type" name="typeId">
                <option>请选择</option>
                <option th:each="type:${doc_type}" th:value="${type.id}" th:text="${type.name}"></option>
            </select>
            <div class="table-responsive">
                <table class="table table-striped">
                    <thead>
                    <tr>
                        <th>姓名</th>
                        <th>性别</th>
                        <th>手机号</th>
                        <th>年龄</th>
                        <th>请选择</th>
                    </tr>
                    </thead>
                    <tbody id="body">
                    <!-- <tr th:each="doctor:${list}">
                         <td th:text="${doctor.name}">Lorem</td>
                         <td th:text="${doctor.sex}">ipsum</td>
                         <td th:text="${doctor.phone}">dolor</td>
                         <td th:text="${doctor.age}">sit</td>
                         <td><input type="radio" name="doctor" th:value="${doctor.id}"></td>
                     </tr>-->
                    </tbody>
                </table>
            </div>


            <div class="form-group">
                <div class="col-sm-8 col-sm-offset-2">
                    <button class="btn btn-lg btn-primary" type="submit">提交</button>
                    <!--<a href="login.html"
                        class="btn btn-lg btn-primary">登陆</a>-->
                </div>
            </div>

        </form>
    </div>
</div>


<!-- 提示信息 -->
<div class="container">
    <div class="col-sm-8 col-sm-offset-1"></div>
</div>

<!--<footer class="footer ">
    <div class="container">
        <div class="row footer-top">
            <div class="col-sm-6 col-lg-6">
                <h4>
                    &lt;!&ndash; <img src="http://static.bootcss.com/www/assets/img/logo.png"> &ndash;&gt;
                </h4>
                <p>
                    本网站所列开源项目的中文版文档全部由<a href="#">用户中心</a>顶力开发 <a href="#"
                        target="_blank">CC BY 3.0</a>协议发布。
                </p>
            </div>
            <div class="col-sm-6  col-lg-5 col-lg-offset-1">
                <div class="row about">
                    <div class="col-xs-3">
                        <h4>关于</h4>
                        <ul class="list-unstyled">
                            <li><a href="#">关于我们</a></li>
                            <li><a href="#">广告合作</a></li>
                            <li><a href="#">友情链接</a></li>
                            <li><a href="#">招聘</a></li>
                        </ul>
                    </div>
                    <div class="col-xs-3">
                        <h4>联系方式</h4>
                        <ul class="list-unstyled">
                            <li><a href="#" title="#" target="_blank">新浪微博</a></li>
                            <li><a href="#">电子邮件</a></li>
                        </ul>
                    </div>
                    <div class="col-xs-3">
                        <h4>旗下网站</h4>
                        <ul class="list-unstyled">
                            <li><a href="#" target="_blank">Laravel中文网</a></li>
                            <li><a href="#" target="_blank">Ghost中国</a></li>
                        </ul>
                    </div>
                    <div class="col-xs-3">
                        <h4>赞助商</h4>
                        <ul class="list-unstyled">
                            <li><a href="#" target="_blank">UCloud</a></li>
                            <li><a href="#" target="_blank">又拍云</a></li>
                        </ul>
                    </div>
                </div>

            </div>
        </div>
        <hr>
        <div class="row footer-bottom">
            <ul class="list-inline text-center">
                <li><a href="#" target="_blank">京ICP备11008151号</a></li>
                <li>京公网安备11010802014853</li>
            </ul>
        </div>
    </div>
</footer>-->
</body>
<script type="text/javascript">
    $("#doctor_type").change(function () {
        var id = $("#doctor_type").val();
        console.log(id);
        $.ajax({
            "url": "/doctor_type?id=" + id,
            "dataType": "json"
        }).done(function (data) {
            data = data.list;
            $("#body").empty()
            for(var i in data)
            {
                $("#body").append($("<tr ><td >" + data[i].name + "</td>" +
                    "<td >" + data[i].sex + "</td><td>" + data[i].phone + "</td><td>"+data[i].age+"</td><td>" +
                    "<input type='radio' name='doctor' value='"+data[i].id+"'></td></tr>"))
            }
            /*for (var i in data) {
                $("#body").append($("<tr ><td >" + data[i].name + "</td>" +
                    "<td >" + data[i].sex + "</td><td>" + data[i].phone + "</td><td>"+data[i].age+"</td><td>" +
                    "<input type='radio' name='doctor' value='"+data[i].id+"'></td></tr>"))

            }*/

        }).fail(function () {
            console.info("失败了")
        })
    })
</script>
</html>